package com.easylinkin.linkappapi.deviceattribute.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Set;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p
 *
 * </p>
 *102255555555500
 * @author TongJie
 * @since 2020-04-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("linkapp_device_attribute")
@ApiModel(description = "设备属性实体类")
public class DeviceAttribute extends Model<DeviceAttribute> {

    private static final long serialVersionUID = 1L;

    @TableId("id")
    @ApiModelProperty(value = "主键ID", name = "id", required = false, example = "")
    private String id;

    @TableField("device_unit_id")
    @ApiModelProperty(value = "设备型号ID", name = "deviceUnitId", required = false, example = "")
    private String deviceUnitId;

    /**
     * 型号code
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "设备型号编码", required = false, example = "")
    private String deviceUnitCode;

    /**
     * 型号版本号
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "设备型号版本号", name = "deviceUnitVersion", required = false, example = "")
    private String deviceUnitVersion;

    /**
     * 父级identifier
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "父属性标识符", name = "parentIdentifier", required = false, example = "")
    private String parentIdentifier;

    @TableField("identifier")
    @ApiModelProperty(value = "属性标识符", name = "identifier", required = false, example = "")
    private String identifier;

    @TableField("name")
    @ApiModelProperty(value = "属性名称", name = "name", required = false, example = "")
    private String name;

    /**
     * 单位
     */
    @TableField("unit")
    @ApiModelProperty(value = "单位", name = "unit", required = false, example = "")
    private String unit;

    @TableField("ico_path")
    @ApiModelProperty(value = "显示图标", name = "icoPath", required = false, example = "")
    private String icoPath;

    @TableField("type")
    @ApiModelProperty(value = "类型", name = "type", required = false, example = "0")
    private Integer type;

    @TableField("specs")
    @ApiModelProperty(value = "规范", name = "specs", required = false, example = "")
    private String specs;

    @TableField("sort_no")
    @ApiModelProperty(value = "排序号", name = "sortNo", required = false, example = "0")
    private Integer sortNo;

    @TableField("is_show")
    @ApiModelProperty(value = "是否展示", name = "isShow", required = false, example = "")
    private Boolean isShow;

    @TableField("description")
    @ApiModelProperty(value = "描述", name = "description", required = false, example = "")
    private String description;

    @TableField("expression")
    @ApiModelProperty(value = "属性表达式", name = "expression", required = false, example = "")
    private String expression;
    
    @TableField("version")
    @ApiModelProperty(value = "版本号", name = "version", required = false, example = "")
    private String version;

    /**
     * 数据字典code
     */
    @TableField("dict_code")
    @ApiModelProperty(value = "数据字典", name = "dictCode", required = false, example = "")
    private String dictCode;

    /**
     * 父级id
     */
    @TableField("parent_id")
    @ApiModelProperty(value = "父ID", name = "parentId", required = false, example = "")
    private String parentId;

    @TableField("create_time")
    private Date createTime;

    @TableField("creator")
    private String creator;

    @TableField("modifier")
    private String modifier;

    @TableField("modify_time")
    private Date modifyTime;

    /**
     * 对应设备属性状态表中的 prop_value 属性值
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "属性值", name = "propValue", required = false, example = "")
    private String propValue;
    
    /**
     * 租户id 查询用
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "租户ID", name = "tenantId", required = false, example = "")
    private String tenantId;

    /**
     * 可视化配置
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "可视化配置", name = "visualizationConfig", required = false, example = "")
    private String visualizationConfig;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @TableField(exist = false)
    @ApiModelProperty(value ="层级", name = "level", required = false, example = "1")
    private Integer level;

    /**
     * 数组序号
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "数组序号", name = "arrayIndex", required = false, example = "0")
    private Integer arrayIndex;

    /**
     * 子属性列表
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "子属性列表", name = "childAttributeList", required = false)
    private List<DeviceAttribute> childAttributeList;

    /**
     * 父属性的编码
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "父属性的编码", name = "parentPropCode", required = false, example = "")
    private String parentPropCode;

    /**
     * 父属性类型
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "父属性类型", name = "parentUnit", required = false, example = "")
    private String parentUnit;

    /**
     * [ "int", "double", "enum", "string",PhysicalModelTypeConstant.OBJECT,PhysicalModelTypeConstant.ARRAY_SIMPLE,PhysicalModelTypeConstant.ARRAY_OBJECT ]
     */
    @TableField(exist = false)
    private Set<String> typeCodes;

    @TableField(exist = false)
    private String projectCode;

}
